package www.dianbaozu.com.ui.chat.findFriend.holder

import androidx.databinding.DataBindingUtil
import com.netease.nim.uikit.common.ui.recyclerview.adapter.BaseQuickAdapter
import com.netease.nim.uikit.common.ui.recyclerview.holder.BaseViewHolder
import com.netease.nim.uikit.common.ui.recyclerview.holder.RecyclerViewHolder
import www.wen.com.common.databinding.ItemHeaderBinding

class HeaderViewHolder(baseQuickAdapter: BaseQuickAdapter<Any, BaseViewHolder>) :
    RecyclerViewHolder<BaseQuickAdapter<Any, BaseViewHolder>, BaseViewHolder, Any>(
        baseQuickAdapter
    ) {
    private var binding: ItemHeaderBinding? = null

    override fun convert(
        holder: BaseViewHolder,
        data: Any,
        position: Int,
        isScrolling: Boolean
    ) {
        if (data is String) {
            data.let {
                binding = DataBindingUtil.bind(holder.itemView)
                binding?.apply {
                    itemText.text = it
                }
            }
        }
    }
}